﻿@model List<MvcMusicStore.Models.Album>
@{
    ViewBag.Title = "ASP.NET MVC Music Store";
}
<div id="promotion" style="display: inline-block;">
</div>

<div id="news" style="width: 400px; height: 300px; display: inline-block; vertical-align: top;">
    <h2 class="musicHeadline">MJ still alive, Vegas romp with Elvis</h2>
    <p class="musicArticle">"The King of Pop" and "The King" were spotted together gambling at the Mandalay Bay Resort & Casino this past weekend. The pair were in the high stakes room playing blackjack.<br /><br />The appearence of the stars left many confused, but when asked a spokesperson for Mr. Jackson said that "Michael just loves ASP.NET MVC" and that he was "In town to learn a bit more about HTML5 at the Microsoft Mix conference."<br /><br />THIS NEWS IS NOT REAL.  BUT KEEP YOUR EYES PEELED HERE AND WE WILL BE SURE TO BRING YOU NEWS OF A MORE 'ACCURATE' FASHION.</p>
    <a href="#">Read More...</a>
</div>

<h3><em>Fresh</em> off the grill</h3>

<ul id="album-list">
    @foreach (var album in Model)
    {
        <li data-albumId="@album.AlbumId"><a href="@Url.Action("Details", "Store",
                                 new { id = album.AlbumId })">

                <img alt="@album.Title" src="@album.AlbumArtUrl" />
                <span>@album.Title</span> </a>
        </li>
    }
</ul>

@section JavaScript{
    <script type="text/javascript">
        var i = 0;
        $(document).ready(function () {
            setInterval(function () { 
                $.get('/Home/News', function (result) {
                    $('#news').fadeOut(function () {
                        $(this).html(result).fadeIn();
                    });
                });
            }, 10000);
        });
    </script>
}